export const getPlatformDefaultId = () => {
	if (process.env.UNI_PLATFORM === "h5") {
		return "h5-default-id";
	}
	if (process.env.UNI_PLATFORM === "mp-weixin") {
		return wx.getAccountInfoSync().miniProgram.appId;
	}
	return "unknown-platform";
};
export const safeGetPushId = () => {
	try {
		if (!window.plus) throw new Error("plus未定义");
		const pinf = plus.push.getClientInfo();
		const pushId = useUniversalStorage("push_cid", "");
		return pinf?.clientid || pushId || "";
	} catch (e) {
		console.error("获取推送ID异常:", e);
		return "";
	}
};
export default {
	getPlatformDefaultId,
	safeGetPushId,
};
